﻿<br />
<div class="code">
&#64;model&nbsp;ProfitModel<br />
<br />
&lt;p&gt;Enter&nbsp;profile:&nbsp;&lt;input&nbsp;&#64;Html.KoAttrValue(m&nbsp;=&gt;&nbsp;m.Profit,&nbsp;KoValueUpdate.AfterKeyDown)/&gt;&lt;/p&gt;<br />
<br />
&lt;p&gt;Profit&nbsp;(negative&nbsp;<span class="Keyword">is</span>&nbsp;red,&nbsp;more&nbsp;than&nbsp;10&nbsp;is&nbsp;green,&nbsp;less&nbsp;than&nbsp;-10&nbsp;or&nbsp;more&nbsp;100&nbsp;is&nbsp;bold):<br />
&lt;span&nbsp;&#64;Html.KoAttrText(m&nbsp;=&gt;&nbsp;m.Profit).KoAttrStyle(<span class="String">"color"</span>,<br />
&nbsp;m&nbsp;=&gt;&nbsp;m.Profit&nbsp;&gt;&nbsp;10&nbsp;?&nbsp;<span class="String">"green"</span>&nbsp;:&nbsp;(m.Profit&nbsp;&lt;&nbsp;0&nbsp;?&nbsp;<span class="String">"red"</span>&nbsp;:&nbsp;<span class="String">"black"</span>&nbsp;)).KoAttrStyle(<span class="String">"font-weight"</span>,<br />&nbsp;m&nbsp;=&gt;&nbsp;m.Profit&nbsp;&lt;&nbsp;-10&nbsp;||&nbsp;m.Profit&nbsp;&gt;&nbsp;100&nbsp;?&nbsp;<span class="String">"bold"</span>&nbsp;:&nbsp;<span class="String">"normal"</span>)&gt;&lt;/span&gt;&lt;/p&gt;<br />
<br />
<br />
&#64;Model.ApplyBindingsScript(KoBindingOptions.IncludeData)
</div>